1. Field of the Invention
The present invention relates to a moving picture encoding apparatus for encoding a moving picture.
2. Description of the Related Art
The MPEG is known as a technology of compressing and encoding a moving picture. In the MPEG, a moving picture is encoded with utilizing a combination of inter prediction, intra prediction, discrete cosine transformation (DCT) and variable-length encoding. In the H.264/AVC, if a texture of a moving picture is complex, a block of a moving picture is intra-predicted by a block unit of 4×4 pixels (hereinafter, referred to as “intra 4×4 prediction mode”), and if a texture of a moving picture is flat and simple, a target block of a moving picture is intra-predicted by a macro-block unit of 16×16 pixels (hereinafter, referred to as “intra 16×16 prediction mode”), so that the encoding efficiency of a moving picture is improved. In both cases, decoded pixels of the blocks neighbouring to the target block are used as reference pixels, and the difference between the original picture and a reference picture, i.e., prediction picture created based on the decoded pixels is encoded.
In the intra 16×16 prediction mode, there are four modes by each macro-block, and in the intra 4×4 prediction mode, there are nine modes by each 4×4 pixel block. In a selection processing of this intra 4×4 prediction mode, encoding costs for nine modes are calculated to select an encoding cost minimizing mode as the optimal encoding mode. Generally SAD (sum of absolute difference) between the original and reference picture is used as the encoding cost. Since the selection processing of this intra 4×4 prediction mode has a large number of modes of nine, the throughput required for calculating the encoding cost is high. On the other hand, if a mode is selected without using a suitable encoding cost, the encoding performance is severely affected.
Here, the number of pixels used for encoding cost calculation to select the intra 4×4 prediction mode is disclosed in Bojun Meng et. al. “Efficient Intra-Prediction Algorithm in H.264”, ICIP 2003. In the middle or later part in the first chapter of this document, the algorithm of the reference software JM5.0 used in the JTV standardization is described. That is, in the equation (1) of Bojun Meng et. al. “Efficient Intra-Prediction Algorithm in H.264”, ICIP 2003, SAD SAD—16 is added to all pixels in a 4×4 pixel block and encoding cost 4pλ(Qp) is added to the bit amount of encoding mode information (vertical prediction, horizontal prediction, etc.), calculating Cost—4×4 of the intra 4×4 prediction to select an encoding cost minimizing mode.
Further, in the second chapter of Bojun Meng et. al. “Efficient Intra-Prediction Algorithm in H.264”, ICIP 2003, there is described the EIP method. That is, in the equation (3) of this document, SAD SAD—4 is added to four sub-sampled pixels and encoding cost pλ(Qp) is added to the bit amount of encoding mode information, calculating the encoding cost by using Cost—4 of the intra 4×4 prediction to select an encoding cost minimizing mode.
However, target pixels in the 4×4 pixel block to be encoded are liable to have more similar pixel values in the prediction picture as they are spatially nearer to a neighboring block and to have more different picture values in the reference picture as they are spatially further from the neighboring block. Thus, the most part of the SAD of the 4×4 pixels obtained as the encoding cost is considered to consist largely of the SAD which is spatially far from the neighboring block.